﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="value_add.aspx.cs" Inherits="manage_channel_value_add" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>增加字段</title>
<link href="../../sysImages/<%Response.Write(NetCMS.Config.UIConfig.CssPath());%>/css/css.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="../../configuration/js/Prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="../../configuration/js/Public.js"></script>
</head>
<body onload="getValue(this.form1.vType.value);">
    <form id="form1" runat="server">
    <div>
    <table id="top1" width="100%"  border="0" cellpadding="0" cellspacing="0" class="toptable">
        <tr>
          <td height="1" colspan="2"></td>
        </tr>
        <tr>
          <td width="57%" class="sysmain_navi" style="padding-left:14px;">添加字段</td>
          <td width="43%">位置导航：<a href="../main.aspx" class="list_link" target="sys_main">首页</a><img alt="" src="../../sysImages/folder/navidot.gif" border="0" /><a href="list.aspx" class="list_link" target="sys_main">频道列表</a><img alt="" src="../../sysImages/folder/navidot.gif" border="0" /><a href="value.aspx?ChID=<%Response.Write(Request.QueryString["ChID"]); %>" class="list_link" target="sys_main">字段管理</a><img alt="" src="../../sysImages/folder/navidot.gif" border="0" />添加字段</td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
    
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">所属频道</td>
        <td style="width:80%">
         <span id="ChannelName" class="reshow" runat="server" width="280px"></span>
       </td>
      </tr>    
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">字段中文名称</td>
        <td style="width:80%">
         <asp:TextBox ID="CName" runat="server" Width="280px" MaxLength="50"></asp:TextBox><span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_CName',this)">帮助</span>
         <asp:RequiredFieldValidator ID="f_CName" runat="server" ControlToValidate="CName" Display="Dynamic" ErrorMessage="<span class='reshow'>！请填写字段中文名称</span>"></asp:RequiredFieldValidator>
         
       </td>
      </tr>
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">字段英文名称(别名)</td>
        <td style="width:80%">
         <asp:TextBox ID="EName" runat="server" Width="280px" Text="ch_" MaxLength="50"></asp:TextBox><span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_EName',this)">帮助</span> <span class="reshow">创建后不能修改</span>
         <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="EName" Display="Dynamic" ErrorMessage="<span class='reshow'>！请填写字段英文名称</span>"></asp:RequiredFieldValidator>
         <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="EName"  Display="Dynamic" ErrorMessage="<span class='reshow'>！只能为数字或者字母.第一个必须为字母,长度：3-50字符</span>" ValidationExpression="^[a-zA-Z][a-zA-Z0-9_]{2,50}"></asp:RegularExpressionValidator>
       </td>
      </tr>
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">字段类型</td>
        <td style="width:80%">
         <span id="vType" runat="server">读取配置文件中...</span><span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_vType',this)">帮助</span>
         <span class="reshow">创建后不能修改</span>
       </td>
          
      </tr>
      
      <tr class="TR_BG_list" style="display:none;" id="Trvitem">
        <td style="width:20%;text-align:right;">选项<br /><span class="reshow">一行一个</span></td>
        <td style="width:80%">
         <asp:TextBox ID="vitem" TextMode="MultiLine" Height="100px" Width="320px" runat="server"></asp:TextBox>
         <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_vDescript',this)">帮助</span>
         
       </td>
      </tr>  
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">默认值</td>
        <td style="width:80%">
         <asp:TextBox ID="vValue" runat="server" Width="280px" MaxLength="200"></asp:TextBox><span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_vValue',this)">帮助</span> <span id="mValue" class="reshow" style="display:none;">多个选项,请用"|"分开</span>
         
       </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">字段描述</td>
        <td style="width:80%">
         <asp:TextBox ID="vDescript" runat="server" Width="280px" MaxLength="200"></asp:TextBox><span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_vDescript',this)">帮助</span>
         
       </td>
      </tr>     
      
      <tr class="TR_BG_list" id="TrvLength">
        <td style="width:20%;text-align:right;">表单长度</td>
        <td style="width:80%">
         <asp:TextBox ID="vLength" runat="server" Width="280px" MaxLength="10">200</asp:TextBox>px<span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_vLength',this)">帮助</span>
         
       </td>
      </tr>
      
      <tr class="TR_BG_list" id="TrHeight" style="display:none;">
        <td style="width:20%;text-align:right;">表单高度</td>
        <td style="width:80%">
         <asp:TextBox ID="vHeight" runat="server" Width="280px" MaxLength="10">200</asp:TextBox>px<span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_vHeight',this)">帮助</span>
         
       </td>
      </tr>      
      <tr class="TR_BG_list" id="TrHTMLedit" style="display:none;">
        <td style="width:20%;text-align:right;">编辑器样式</td>
        <td style="width:80%">
            <asp:DropDownList ID="HTMLedit" runat="server">
            <asp:ListItem Value="0">无编辑器</asp:ListItem>
            <asp:ListItem Value="1">简单编辑器</asp:ListItem>
            <asp:ListItem Value="2">标准编辑器</asp:ListItem>
            <asp:ListItem Value="3">完整编辑器</asp:ListItem>
            </asp:DropDownList>
         <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_vLength',this)">帮助</span>
         
       </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">允许为空</td>
        <td style="width:80%">
         <asp:CheckBox ID="isNulls" runat="server" Checked="true" />
         <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_isNulls',this)">帮助</span>
         
       </td>
      </tr>
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">显示在搜索中</td>
        <td style="width:80%">
         <asp:CheckBox ID="isSearch" runat="server" />
         <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_isNulls',this)">帮助</span>
       </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">是否锁定</td>
        <td style="width:80%">
         <asp:CheckBox ID="isLock" runat="server" />
         <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_isLock',this)">帮助</span>
         
       </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">会员中显示此表单</td>
        <td style="width:80%">
         <asp:CheckBox ID="isUser" runat="server" />
         <span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_isUser',this)">帮助</span>
       </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;">权重</td>
        <td style="width:80%">
         <asp:TextBox ID="OrderID" runat="server" Width="280px" MaxLength="2">0</asp:TextBox><span class="helpstyle" style="cursor:help;" title="点击显示帮助" onclick="Help('H_value_OrderID',this)">帮助</span>
         
       </td>
      </tr>
      
      <tr class="TR_BG_list">
        <td style="width:20%;text-align:right;"></td>
        <td style="width:80%">
         <asp:Button ID="Button1" runat="server" Text="保存字段" OnClick="Button1_Click" />
         &nbsp;<input type="reset" value="重新填写" />
        </td>
      </tr>
    </table>
    <br />
    <br />
    <table width="100%" border="0" cellpadding="8" cellspacing="0" class="copyright_bg" style="height: 76px">
       <tr>
         <td align="center"><label id="copyright" runat="server" /></td>
       </tr>
    </table>
    </div>
    </form>
</body>
</html>
<script language="javascript" type="text/javascript">
function getValue(obj)
{  
   var TrCols = document.getElementById("Trvitem");
   var TrmValue = document.getElementById("mValue");
   var TrvLength =document.getElementById("TrvLength"); 
   var TrHTMLedit =document.getElementById("TrHTMLedit"); 
   var TrHeight =document.getElementById("TrHeight"); 
   switch(obj)
   {
       case "6":
          TrCols.style.display="";
          
          TrmValue.style.display="none";
          TrvLength.style.display="";
          TrHTMLedit.style.display="none";
          TrHeight.style.display="none";
          break;
       case "12":case "13":
          TrCols.style.display="";
          TrmValue.style.display="none";
          TrvLength.style.display="none";
          TrHTMLedit.style.display="none";
          TrHeight.style.display="none";
          break;
       case "14":
          TrCols.style.display="";
          TrmValue.style.display="";
          TrHTMLedit.style.display="none";
          TrvLength.style.display="none";
          TrHeight.style.display="none";
          break;
      case "15":
          TrCols.style.display="";
          TrmValue.style.display="";
          TrHTMLedit.style.display="none";
          TrvLength.style.display="none";
          TrHeight.style.display="none";
          break;
       case "16":
          TrCols.style.display="";
          TrmValue.style.display="";
          TrHTMLedit.style.display="none";
          TrvLength.style.display="";
          TrHeight.style.display="";
          break;
       case "17":
          TrCols.style.display="none";
          TrmValue.style.display="none";
          TrvLength.style.display="";
          TrHTMLedit.style.display="";
          TrHeight.style.display="";
           break;
       case "5":
          TrCols.style.display="none";
          TrmValue.style.display="none";
          TrvLength.style.display="";
          TrHTMLedit.style.display="none";
          TrHeight.style.display="";
           break;
       default:
          TrCols.style.display="none";
          TrmValue.style.display="none";
          TrvLength.style.display="";
          TrHTMLedit.style.display="none";
          TrHeight.style.display="none";
          break;
   }
}
</script>